package xin.marcher.module.common.enums;

/**
 * 产品标识类型枚举
 */
public enum ProductTypeEnum {

    /**
     * item
     */
    ITEM(1, "ITEM", "100000"),

    /**
     * sku
     */
    SKU(2, "SKU", "8000");

    private Integer code;

    private String name;

    private String value;

    ProductTypeEnum(Integer code, String name, String value) {
        this.code = code;
        this.name = name;
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public String getValue() {
        return value;
    }

    public static ProductTypeEnum getByCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (ProductTypeEnum element : ProductTypeEnum.values()) {
            if (code.equals(element.getCode())) {
                return element;
            }
        }
        return null;
    }

}